package cn.wolfcode.p2p.business.query;

import cn.wolfcode.p2p.base.query.QueryObject;
import cn.wolfcode.p2p.util.DateUtil;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.util.StringUtils;

import java.util.Date;

@Setter
@Getter
public class RechargeOfflineQuery extends QueryObject {
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date beginDate; //开始时间

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate; //结束时间

    private Integer state = -1; //状态,默认全部

    private Long bankInfoId = -1L; //开户行id, 默认全部

    private String tradeCode; //交易号

    public String getTradeCode() {
        return StringUtils.hasLength(tradeCode) ? tradeCode.trim() : null;
    }

    public Date getEndDate() {
        return DateUtil.getEndDate(endDate);
    }
}
